package com.digitalchina.lxnsy.viewholder;

import android.view.ViewGroup;
import android.widget.TextView;

import com.digitalchina.lxnsy.R;
import com.digitalchina.lxnsy.entity.MyExchangeVO;
import com.jude.easyrecyclerview.adapter.BaseViewHolder;

/**
 * ================================================
 * 项目名称：BigData
 * 类描述：
 * 包名：com.digitalchina.bigdata.viewholder
 * 创建人：白彦东
 * 创建时间：2016/12/28 18:10
 * 修改备注：
 * ================================================
 */

public class MyExchangeHolder extends BaseViewHolder<MyExchangeVO> {

    private TextView tvTime;
    private TextView tvName;
    private TextView tvPrice;
    private TextView tvNum;


    public MyExchangeHolder(ViewGroup parent) {
        super(parent, R.layout.item_my_exchange);
        tvTime = $(R.id.my_ex_tv_time);
        tvName = $(R.id.my_ex_tv_name);
        tvPrice = $(R.id.my_ex_tv_price);
        tvNum = $(R.id.my_ex_tv_num);
    }

    @Override
    public void setData(MyExchangeVO data) {
        super.setData(data);

        tvTime.setText((data.getCreateAt() + "").replace(" ","\n"));
        tvName.setText(data.getName() + "");
        tvPrice.setText(data.getPointTotalValue() + "");
        tvNum.setText("x" + data.getExchangeAmount());
    }

}
